<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>选择器</title>
</head>
<body>


<div id="box1" class="box">
   box-1
</div>

<div class="box" id="box2">
  box-2

</div>
</body>
<script>
      /*1.选择器
      *   标签选择器
      *   类选择器
      *   id选择器
      * */

    var boxes= document.getElementsByTagName('div');
    console.log(boxes);
    boxes[0].innerText = 'hello box-1';

   var boxes2=  document.getElementsByClassName('box');
   console.log(boxes2);


   var box1= document.getElementById('box1');
   console.log(box1);


</script>

</html>